// property 实体的路由

const express = require('express');

const router = express.Router();

// 导入操作
const property_handler = require('../router_handler/property_handler');

// 导入校验

const expressJoi = require('@escook/express-joi');

const { add_property_schema,update_property_schema,del_get_property_schema } = require('../schema/property_scheam.js');

// 路由设置

// 获取所有的property

router.get('/', property_handler.getPropertyList);

// 添加property

router.post('/', expressJoi(add_property_schema), property_handler.addProperty);

// 删除property

router.delete('/:id',expressJoi(del_get_property_schema), property_handler.deleteProperty);

// 修改

router.put('/', expressJoi(update_property_schema), property_handler.updateProperty);


router.get('/:id', expressJoi(del_get_property_schema), property_handler.getPropertyList);

// 导出路由
module.exports = router;